package com.gongj.populateBean.autowired;

import com.gongj.xml.bean.User;
import org.omg.CORBA.INTERNAL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

//@Component
public class UserService {


	//@Autowired
	//@Value("${user.name}")
			//@Lazy
	OrderService orderService;


	public UserService(){
		System.out.println("xml 无参构造注入" + orderService);
	}

	//@Autowired
	public UserService(OrderService orderService1){
		System.out.println("有参构造注入" + orderService1);
		orderService = orderService1;
	}

	public UserService(OrderService orderService1,OrderService orderService2){
		System.out.println("两个参数有参构造注入" + orderService1 +"==="+ orderService2);
		orderService = orderService1;
	}

	public void test(){
		System.out.println("test=" + orderService);
	}
	//@Autowired
	public void setOrder(OrderService order){
		System.out.println("xml property方法注入" + order);
		orderService = order;
	}
	public void setOrderService(OrderService order){
		System.out.println("byName 方法注入" + order);
		orderService = order;
	}
	private void setaaa(OrderService orderService,String a){}

	private String getaaa(OrderService orderService){
		return null;
	}
	// 解析
	public String getba(){
		return null;
	}
	// 解析
	public boolean isDel(){
		return false;
	}

	//@Autowired
	public void yyy(OrderService orderService){
		System.out.println("yyy=" + orderService);
		this.orderService = orderService;
	}


	public void xxx(@Autowired OrderService orderService){
		System.out.println("xxx=" + orderService);
		this.orderService = orderService;
	}
	//@Autowired
	private List<OrderService> os;
	//@Autowired
	private Map<String,OrderService> maps;
	//@Autowired
	OrderService[] ar;
	public void otherAutowiring() {
		System.out.println(os);
		System.out.println(maps);
		System.out.println(ar);
	}
}
